angular.module('feibo.teacher.service')
       .service('TeacherService', ['CommonService', function(CommonService){
                return {
                       fetchTeacherGroup: function(queryConfig){
                             queryConfig.endpoint = ENDPOINTS.teacher.group.fetch;
                             return CommonService.fetch(queryConfig);
                       },
                       getDetailByGroupId:function(queryConfig){
                              queryConfig.endpoint = ENDPOINTS.teacher.groupdetail.fetch;
                              return CommonService.get(queryConfig);
                       },
                       getAvailableTeacher: function(queryConfig){
                            queryConfig.endpoint = ENDPOINTS.course.teacher.available;
                            return CommonService.get(queryConfig);
                       },
                       fetchTeacherProfile: function(queryConfig){
                            queryConfig.endpoint = ENDPOINTS.teacher.profile;
                            return CommonService.get(queryConfig);
                       },
                       // 专属老师合同
                       fetchTeacherContract: function(queryConfig){
                            queryConfig.endpoint = ENDPOINTS.teacher.contract;
                            return CommonService.get(queryConfig);
                       },
                       addTeacherContract: function(postConfig){
                            postConfig.endpoint = ENDPOINTS.teacher.add_contract;
                            return CommonService.post(postConfig);
                       },
                       getTeacherContract: function(queryConfig){
                            queryConfig.endpoint = ENDPOINTS.teacher.get_contract;
                            return CommonService.get(queryConfig);
                       },
                       getTeacherContractList: function(queryConfig){
                            queryConfig.endpoint = ENDPOINTS.teacher.contractList;
                            return CommonService.get(queryConfig);
                       },
                       updateTeacherContract: function(putConfig){
                            putConfig.endpoint = ENDPOINTS.teacher.get_contract;
                            return CommonService.put(putConfig);
                       },
                       deleteTeacherContract: function(deleteConfig){
                            deleteConfig.endpoint = ENDPOINTS.teacher.get_contract;
                            return CommonService.delete(deleteConfig);
                       },
                       // 专属老师群
                       fetchTeacherPack: function(queryConfig){
                            queryConfig.endpoint = ENDPOINTS.teacher.pack;
                            return CommonService.get(queryConfig);
                       },
                       addTeacherPack: function(postConfig){
                            postConfig.endpoint = ENDPOINTS.teacher.pack_add;
                            return CommonService.post(postConfig);
                       },
                       getPackInfo: function(queryConfig){
                            queryConfig.endpoint = ENDPOINTS.teacher.pack_info;
                            return CommonService.get(queryConfig);
                       },
                       updatePack: function(putConfig){
                            putConfig.endpoint = ENDPOINTS.teacher.pack_info;
                            return CommonService.put(putConfig);
                       },
                       deletePack: function(deleteConfig){
                            deleteConfig.endpoint = ENDPOINTS.teacher.pack_info;
                            return CommonService.delete(deleteConfig);
                       },
                       // 班型大类
                       fetchClassType: function(queryConfig){
                            queryConfig.endpoint = ENDPOINTS.teacher.class_type;
                            return CommonService.get(queryConfig);
                       },
                       addClassType: function(postConfig){
                            postConfig.endpoint = ENDPOINTS.teacher.add_type;
                            return CommonService.post(postConfig);
                       },
                       getClassType: function(queryConfig){
                            queryConfig.endpoint = ENDPOINTS.teacher.type_info;
                            return CommonService.get(queryConfig);
                       },
                       updateClassType: function(putConfig){
                            putConfig.endpoint = ENDPOINTS.teacher.type_info;
                            return CommonService.put(putConfig);
                       },
                       deleteType: function(deleteConfig){
                            deleteConfig.endpoint = ENDPOINTS.teacher.type_info;
                            return CommonService.delete(deleteConfig);
                       },
                       // 班型小类
                       fetchClassMiniType: function(queryConfig){
                            queryConfig.endpoint = ENDPOINTS.teacher.mini_class_type;
                            return CommonService.get(queryConfig);
                       },
                       addClassMiniType: function(postConfig){
                            postConfig.endpoint = ENDPOINTS.teacher.mini_add_type;
                            return CommonService.post(postConfig);
                       },
                       getClassMiniType: function(queryConfig){
                            queryConfig.endpoint = ENDPOINTS.teacher.mini_type_info;
                            return CommonService.get(queryConfig);
                       },
                       updateClassMiniType: function(putConfig){
                            putConfig.endpoint = ENDPOINTS.teacher.mini_type_info;
                            return CommonService.put(putConfig);
                       },
                       deleteMiniType: function(deleteConfig){
                            deleteConfig.endpoint = ENDPOINTS.teacher.mini_type_info;
                            return CommonService.delete(deleteConfig);
                       },
                       addShiftTimeSlot: function(postConfig){
                            postConfig.endpoint = ENDPOINTS.teacher.add_shift_time_slot;
                            return CommonService.post(postConfig);
                       },
                       updateShiftTimeSlot: function(putConfig){
                            putConfig.endpoint = ENDPOINTS.teacher.update_shift_time_slot;
                            return CommonService.put(putConfig);
                       },
                       fetchTeachers: function(queryConfig){
                            queryConfig.endpoint = ENDPOINTS.teacher.fetchTeachers;
                            return CommonService.get(queryConfig);
                       },
                       addBuyTeacher: function(postConfig){
                            postConfig.endpoint = ENDPOINTS.teacher.add_buy_teacher;
                            return CommonService.post(postConfig);
                       },
                       getBuyoutTeacherCalendar: function(queryConfig){
                            queryConfig.endpoint = ENDPOINTS.teacher.buyout_teacher_calendar;
                            return CommonService.get(queryConfig);
                       },
                       getBuyoutTeacher: function(queryConfig){
                            queryConfig.endpoint = ENDPOINTS.teacher.get_buyout_teacher;
                            return CommonService.get(queryConfig);
                       },
                       fillCalendar: function(postConfig){
                            postConfig.endpoint = ENDPOINTS.teacher.fillCalendar;
                            return CommonService.post(postConfig);
                       },
                       clearCalendar: function(postConfig){
                            postConfig.endpoint = ENDPOINTS.teacher.clearCalendar;
                            return CommonService.post(postConfig);
                       },
                };
       }]);
